package modelLayer;

import java.io.Serializable;
import java.util.Date;

@SuppressWarnings("serial")
public class Pallet implements Serializable{

	private int palletID;
	private String batchNo;
	private int numberOfPlates;
	private int supplierFail;
	private String supplierComment;
	private Date startDate; 
	private Date finishDate; 
	private int statusOnStore;  // 1 = on store, 2 = in use in production, 3 = is finish, 4 = sent back to supplier ... 
	private Store store;
	private Person pObj;


	private Product product;  //a product with productName and productColorCode

	public Pallet(String batchNo)
	{
		//		this.palletID = palletID;
		this.batchNo = batchNo;
		this.numberOfPlates = 0;
		this.supplierFail = 0;
		//		this.startDate = startDate;
		this.statusOnStore = 1;
		this.product = null;

	}



	public Pallet() {
		// TODO Auto-generated constructor stub
	}



	public int getPalletID() {
		return palletID;
	}

	public void setPalletID(int palletID) {
		this.palletID = palletID;
	}


	//add a product(description to the pallet)
	public void setProduct(Product product)
	{
		this.product = product;
	}

	public Product getProduct()
	{
		return product;		
	}

	public String getBatchNo() {
		return batchNo;
	}

	public void setBatchNo(String batchNo) {
		this.batchNo = batchNo;
	}

	public int getNumberOfPlates() {
		return numberOfPlates;
	}


	public void setNumberOfPlates(int numberOfPlates) {
		this.numberOfPlates = numberOfPlates;
	}

	public int getSupplierFail() {
		return supplierFail;
	}

	public void setSupplierFail(int supplierFail) {
		this.supplierFail = supplierFail;
	}

	public int updateSupplierFail(int supplierFail)
	{
		return this.supplierFail =+ supplierFail;
	}

	public Date getStartDate() {
		return startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	public Date generateStartDate(){
		//lazy implement
		java.util.Date utilDate = new java.util.Date();
		java.sql.Date sqlDate = new java.sql.Date(utilDate.getTime());

		return sqlDate;
	}

	public Date getFinishDate() {
		return finishDate;
	}

	public void setFinishDate(Date finishDate) {
		this.finishDate = finishDate;
	}

	public int getStatusOnStore() {
		return statusOnStore;
	}

	public void setStatusOnStore(int statusOnStore) {
		this.statusOnStore = statusOnStore;
	}



	public String getSupplierComment() {
		return supplierComment;
	}



	public void setSupplierComment(String supplierComment) {
		this.supplierComment = supplierComment;
	}



	public Store getStore() {
		return store;
	}



	public void setStore(Store store) {
		this.store = store;
	}



	public Person getpObj() {
		return pObj;
	}



	public void setpObj(Person pObj) {
		this.pObj = pObj;
	}



}
